Towards Optimal Range Medians
نویسندگان
چکیده
We consider the following problem: Given an unsorted array of n elements, and a sequence of intervals in the array, compute the median in each of the subarrays defined by the intervals. We describe a simple algorithm which needs O(n log k + k logn) time to answer k such median queries. This improves previous algorithms by a logarithmic factor and matches a comparison lower bound for k = O(n). The space complexity of our simple algorithm is O(n logn) in the pointer-machine model, and O(n) in the RAM model. In the latter model, a more involved O(n) space data structure can be constructed in O(n logn) time where the time per query is reduced to O(logn/ log log n). We also give efficient dynamic variants of both data structures, achieving O(log n) query time using O(n logn) space in the comparison model and O((logn/ log logn)) query time using O(n logn/ log log n) space in the RAM model, and show that in the cell-probe model, any data structure which supports updates in O(log n) time must have Ω(logn/ log log n) query time. Our approach naturally generalizes to higher-dimensional range median problems, where element positions and query ranges are multidimensional — it reduces a range median query to a logarithmic number of range counting queries.
منابع مشابه
Joint Distributions of Weighted Medians on Overlapping Windows in Image Analysis
In this paper, we derive the joint distribution function of the output of weighted median lters with independent but not identically distributed inputs on overlapping windows which may contain an image feature such as a line or edge. These results are used to derive the probability distributions of the diierence between the weighted medians calculated on two adjacent overlapping windows. As an ...
متن کاملFinding an Optimal Inversion Median: Experimental Results
We derive a branch-and-bound algorithm to find an optimal inversion median of three signed permutations. The algorithm prunes to manageable size an extremely large search tree using simple geometric properties of the problem and a newly available linear-time routine for inversion distance. Our experiments on simulated data sets indicate that the algorithm finds optimal medians in reasonable tim...
متن کاملAntegrade intramedullary pinning versus retrograde intramedullary pinning for displaced fifth metacarpal neck fractures.
BACKGROUND Severe angulation or shortening can be a surgical indication for fifth metacarpal neck fracture. In a previous meta-analysis, antegrade intramedullary pinning was shown to produce better hand function outcomes than percutaneous transverse pinning or miniplate fixation for treatment of fifth metacarpal neck fractures. However, the outcomes of retrograde intramedullary pinning, to our ...
متن کاملSub-optimality Approximations
The sub-optimality approximation problem considers an optimization problem O, its optimal solution σ∗, and a variable x with domain {d1, . . . , dm} and returns approximations to O[x← d1], . . . ,O[x← dm], where O[x← d1] denotes the problem O with x assigned to di. The sub-optimality approximation problem is at the core of online stochastic optimization algorithms and it can also be used for so...
متن کاملFast median filtering algorithms for mesh computers
Two fast algorithms for median ltering of images using parallel computers having 2-D mesh interconnections are given. Both algorithms assume that an n n image is loaded onto the mesh with one processing element per pixel. One algorithm performs median ltering over d d neighborhoods in O(d 2 ) time and works with pixel values in an arbitrarily large range. This algorithm, while theoretically sub...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2009